import request from "@/utils/request";

export const addDictType = async (params)=>{
    return await request.post(
        "api/sys/dictType/add",
        params,
    )
}

export const updateDictType = async (params)=>{
    return await request.put(
        "api/sys/dictType/update",
        params,
    )
}
export const getDictType = async (current,page,params)=>{
    return await request.get(
        `api/sys/dictType/${current}/${page}/list`,
        params,
    )
}
export const getDictTypeById = async (id)=>{
    return await request.get(
        `api/sys/dictType/${id}/info`,
    )
}

export const delDictTypeById = async (id)=>{
    return await request.deleted(
        `api/sys/dictType/${id}/del`,
    )
}

export const getDictByTypeCodeList = (current, page, params)=>{
    return request.get(
        `api/sys/dict/${current}/${page}/list`,
        params,
    )
}

export const addDict = async (params)=>{
    return await request.post(
        "api/sys/dict/add",
        params,
    )
}

export const getDictByTypeCode = (typeCode) => {
    return request.get(
     `api/sys/dict/${typeCode}/list`
    )
}
export const getDictSelectByTypeCode = (typeCode) => {
    return request.get(
     `api/sys/dict/${typeCode}/select`
    )
}
